package com.lin.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.lin.common.result.PageResult;
import com.lin.entity.dto.DynamicDto;
import com.lin.entity.vo.DynamicEntityVO;
import com.lin.mapper.CommunityMapper;
import com.lin.service.CommunityService.IBmsPostService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IBmsPostServiceImpl implements IBmsPostService{

    @Autowired
    private CommunityMapper communityMapper;

    @Override
    public PageResult getDynamics(DynamicDto dynamicDto) {
        PageHelper.startPage(dynamicDto.getPage(),dynamicDto.getPageSize());
        Page<DynamicEntityVO> page = communityMapper.getdynamic(dynamicDto);
        return new PageResult(page.getTotal(),page.getResult());
    }
}
